﻿using System;
using System.Collections.Generic;

namespace WeatherReport.DataModel
{
    public class WeatherInfo
    {
        private static readonly WeatherInfo _empty = new WeatherInfo();

        private readonly double? _temperature;
        private readonly double? _windDirection;
        private readonly double? _windSpeed;

        public static WeatherInfo Empty
        {
            get { return _empty; }
        }

        public double? Temperature
        {
            get { return _temperature; }
        }

        public double? WindDirection
        {
            get { return _windDirection; }
        }

        public double? WindSpeed
        {
            get { return _windSpeed; }
        }

        public WeatherInfo()
        {
            _temperature = null;
            _windDirection = null;
            _windSpeed = null;
        }

        public WeatherInfo(double? temperature, double? windDirection, double? windSpeed)
        {
            _temperature = temperature;
            _windDirection = windDirection;
            _windSpeed = windSpeed;
        }

        public override bool Equals(object obj)
        {
            WeatherInfo other = obj as WeatherInfo;
            if (other != null)
                return (_temperature == other._temperature &&
                    _windDirection == other._windDirection && _windSpeed == other._windSpeed);

            return false;
        }
    }
}
